﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SportsStore.Domain.Abstract;
using SportsStore.Domain.Concrete;
using System.ComponentModel;

namespace SportsStore.WebUI.Controllers
{
    public class ProductsController : Controller
    {
        public int PageSize = 3;
        private IProductsRepository productsRepository;
        public ProductsController(IProductsRepository productsRepository)
        {
         
            this.productsRepository =  productsRepository;
        }
        public ViewResult List([DefaultValue(1)]int page)
        {
            return View(productsRepository.Products.Skip((page-1) * PageSize).Take(PageSize).ToList());  
        }

    }
}
